package com.hfi.decorator.demo02;

/**
 * 如果只有一个ConcreteComponent类而没有抽象的Component类 那么Decorator类可以是ConcreteComponent的一个子类
 * @author ChangLiang
 * @date 2019/12/3
 */
public class App {

    public static void main(String[] args) {
        ConcreteComponent component = new ConcreteComponent();
        ConcreteComponent decoratorA = new ComponentDecoratorA(component);
        ConcreteComponent decoratorB = new ComponentDecoratorB(decoratorA);
        decoratorB.methodA();
    }
}
